<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${SESSION_COMPANY}-新增角色</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/commonCss.jspf"%>
<%@include file="/resource/common/kindeditor.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<%@include file="/resource/common/showLoading.jspf"%>
<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>
<script type="text/javascript">
    ShowEditorHtml("#description", "word_count");
	var PATH = "${ctx}";
	var result = 0;
	var validateForm;
	
	$(document).ready(function() {
		$("body").showLoading();
		validateForm = $("#inputForm").validate({
			rules : {
				name : {
					required : true
				},
				tag : {
					required : true
				},
				sort : {
					required : true,
					digits:true,
				 	min:0
				}
			},
			messages :{
				name :{
					required : "角色名称不能为空"
				},
				tag :{
					required : "标签必填项"
				},
				sort :{
					required : "排序不能为空,必须为整数",
					digits: "排序必须为整数",
				 	min:"最小值为0"
				}
			},
			errorElement : "em",
			errorClass : "validate_error",
			submitHandler: function(form) { //通过之后回调
			},
			invalidHandler: function(form, validator) {
				return false;
			}
		});
		
		$("body").hideLoading();
	}); 
 	
</script>
</head>
<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box-content">
				<div class="tab-content default-tab" id="tab1">
					<fieldset>
						<input type="hidden" id="asyncResult" name="asyncResult" value="-1" /> 
						<input type="hidden" id="asyncResultData" name="asyncResultData" value="-1" /> 
						<input type="hidden" id="asyncResultError" name="asyncResultError" value="-1" /> 
						<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="">
							<div class="row">
								<div class="col-md-6 col-sm-6 col-xs-6" >
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">角色名称：<span style="color: red">*</span></label>
										<input type="hidden" id="rid" name="rid" value="${role.rid}">
										<div class="col-md-10 col-sm-10 col-xs-10">
											<input type="text" class="form-control input-sm" id="name" name="name" value="${ role.name }" placeholder="角色名称"/>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">排　　序：<span style="color: red">*</span></label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<input type="text" class="form-control input-sm" id="sort" name="sort" value="${ role.sort }" placeholder="排序"/>
										</div>
									</div>
								</div>
								<div class="col-md-6 col-sm-6 col-xs-6" >
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">标　　识：<span style="color: red">*</span></label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<input type="text" class="form-control input-sm" id="tag" name="tag" value="${ role.tag }" placeholder="标识"/>
										</div>
									</div>

								</div>
							</div>
							<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12" >
									<div class="form-group">
										<label class="col-md-1 col-sm-1 col-xs-1 control-label">描　　述：*</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											 <textarea id="description" name="description" style="width:100%; height: 200px; visibility: hidden;">${role.description}</textarea>
										您当前输入了 <span class="word_count">0</span>
										个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。
										</div>
									</div>
								</div>
							</div>
							
						</form:form>

					</fieldset>
				</div>
			</div>
		</div>
	</div>
</body>
</body>
</html>